package com.ly.service;

import com.github.pagehelper.PageInfo;
import com.ly.bean.CarItem;
import com.ly.bean.EasybuyProduct;
import com.ly.bean.EasybuyUser;

import java.util.List;

/**
@author 李岩
@date 2021/12/14-13:52
@describe
*/
public interface ProductService {

    //卖家添加商品信息以及商品详情
    void addProduct(EasybuyProduct product, List<String> productImageString) throws Exception;
    /**
     * 获取前六件商品
     */
    List<EasybuyProduct> selectSixByCategoryLevel1Id(Integer categoryLevel1Id) throws Exception;
    /**
     * 根据商品id查询该商品信息
     */
    EasybuyProduct selectProductByPrimaryKey(Integer id) throws Exception;
    /**
     * 把商品信息添加到redis中
     */
    void addProductCarToRedis(EasybuyProduct product, EasybuyUser user,Integer buyNum) throws Exception;
    //从redis中获取该用户所有的购物车信息
    List<CarItem> findProductCarItemFromRedis(EasybuyUser loginUser) throws Exception;
    //从redis中获取该用户所有的购物车信息
    void deleteProductCarItemFromRedis(EasybuyUser loginUser,Integer pid) throws Exception;
    //利用用户id和商品id从redis中获取确定购买的商品信息
    public CarItem findOrderCarItemFromRedis(Integer uid,Integer pid) throws Exception;

    //根据登录卖家的信息，获取卖家中售卖的商品列表
    PageInfo<EasybuyProduct> selectProductBySellerId(String pageNum,String sellerId) throws Exception;
}
